/* Copyright 2011 Filip Reesalu, Johan Gustafsson, Jonas Bornold
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef H_WEBPNPAPI
#define H_WEBPNPAPI

// Includes
#include "../../include/npapi.h"
#include "../../include/npfunctions.h"

extern "C" // Use C naming convention for these
{
	NPError NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs);
	NPError NP_Shutdown();

	NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData* saved);
	NPError NPP_Destroy(NPP instance, NPSavedData** save);

	NPError NPP_SetWindow(NPP instance, NPWindow* window);

	NPError NPP_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16_t* stype);
	NPError NPP_DestroyStream(NPP instance, NPStream* stream, NPReason reason);

	int32_t NPP_WriteReady(NPP instance, NPStream* stream);
	int32_t NPP_Write(NPP instance, NPStream* stream, int32_t offset, int32_t len, void* buffer);
	void    NPP_StreamAsFile(NPP instance, NPStream* stream, const char* fname);
	void    NPP_Print(NPP instance, NPPrint* platformPrint);
	int16_t NPP_HandleEvent(NPP instance, void* event);
	void    NPP_URLNotify(NPP instance, const char* URL, NPReason reason, void* notifyData);

	NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value);
	NPError NPP_SetValue(NPP instance, NPNVariable variable, void *value);
}

#endif
